/*
 * PublishBasedController.java
 *
 * Created on October 3, 2008, 3:44 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.vacuela.publishmx.web.controllers;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
import org.vacuela.publishmx.context.ServiceContext;
import org.vacuela.publishmx.context.ServiceContextImpl;

/**
 *
 * @author nestor.carrasco
 */
public abstract class PublishBasedController implements Controller{
    
    public abstract ModelAndView commandAction( HttpServletRequest httpServletRequest, 
            HttpServletResponse httpServletResponse, ServiceContext context) throws Exception ;
    
    public final ModelAndView handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
        ServiceContext context = new ServiceContextImpl();
            return commandAction(httpServletRequest,httpServletResponse,context);
    }
    
 
    
}
